package com.reny.ll.git.base_logic.model.login

import android.annotation.SuppressLint
import android.os.Parcelable
import com.reny.ll.git.base_logic.MApp
import com.reny.ll.git.base_logic.config.LOGIN_INFO
import com.reny.ll.git.base_logic.ext.kv
import kotlinx.android.parcel.Parcelize

@SuppressLint("ParcelCreator")
@Parcelize
data class LoginInfo(var access_token: String = "", //token
                    var expires_in: Int = 0, //有效期(秒)
                    var now: Int = 0, //当前时间
                    var token_type: String = ""
): Parcelable




fun LoginInfo.save(){
    //loge("save loginINfo: ${gson.toJson(this)}")
    kv().encode(LOGIN_INFO, this)
    MApp.loginInfo = this
}